<?php
/**
 * Set configuration for locations
 * NAME OF CONFIGURATION VARIABLES
 * 
 *
 *[conf_path]
 *js_path = xxx
 *img_path = xxx
 *css_path = xxx
 *template_path = xxx
 *public_path = xxx
 *componente_path = xxx
 * 
 * @package Nucleo
 * @subpackage Nucleo.Configuration
 * @author Renan Henrique Abreu <renanhabreu@gmail.com>
 * @copyright 2009-2010 Renan Abreu
 */	
abstract class Nucleo_Configuration_Path implements Nucleo_Configuration{
	static private $configured = false;
	
	static public function setConfiguration($fileName){
		
		if(!self::$configured){
			if($configuration = parse_ini_file($fileName,TRUE)){
				$PATH_LIST = $configuration['conf_path'];
						
				if(isset($PATH_LIST)){
					if(isset($PATH_LIST['module_path']))
						$PATH_LIST['template_path'] = $PATH_LIST['module_path'].'/View';
									
					foreach($PATH_LIST as $const=>$value)
						define(strtoupper($const),$value.'/' );																
				}else
					throw new Nucleo_Exception_Sifra('015',true);
						
				self::$configured = true;		
			}else{
				throw new Nucleo_Exception_Load('003');
			}
		}
	}
	
}
?>